#define ElemType int

typedef struct ListNode List_Node;

#include "common.h"

char* reverseStr(char* s, int k);

void reverse(char* s, int start, int end);

int main()
{
	return 0;
}

char* reverseStr(char* s, int k)
{
	for (int i = 0, r = i + k - 1, len = strlen(s); i < len; i += 2 * k, r += 2 * k)
		reverse(s, i, r > (len - 1) ? (len - 1) : r);

	return s;
}

void reverse(char* s, int start, int end)
{
	while (start < end) {
		char t = s[start];
		s[start++] = s[end];
		s[end--] = t;
	}
}
